﻿namespace AnyOffice.WebControls
{
    using System;
    using System.ComponentModel;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    [ToolboxData("<{0}:HFLabel runat=server></{0}:HFLabel>"), DefaultProperty("Text")]
    public class HFLabel : Label
    {
        private string strPropertyName = "";

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }

        [Description("对应实体类属性的名称"), Browsable(true), Category("HFServer"), Bindable(true)]
        public string PropertyName
        {
            get
            {
                if (base.Attributes["PropertyName"] != null)
                {
                    this.strPropertyName = base.Attributes["PropertyName"].Trim();
                }
                return this.strPropertyName;
            }
            set
            {
                this.strPropertyName = value;
                base.Attributes.Add("PropertyName", this.strPropertyName);
            }
        }
    }
}

